function incFontSize()
{

  fsize = getStyle('fontSize') || getStyle('font-size');

  if(fsize.indexOf('%') != -1)
    newFsize = (parseInt(fsize) + 10) + '%'; 
  else if(fsize.indexOf('em') != -1)
    newFsize = (parseFloat(fsize) + 0.1) + 'em';
  else
    newFsize = (parseInt(fsize) + 2) + 'px';

  document.body.style.fontSize = newFsize;

}

function decFontSize()
{
  //alert(getStyle('fontSize'));
  fsize = getStyle('fontSize') || getStyle('font-size');

  //if((parseInt(fsize) - 10) <= 5 ) return 0;
  if(fsize.indexOf('%') != -1)
    newFsize = (parseInt(fsize) - 10) + '%'; 
  else if(fsize.indexOf('em') != -1) {
   // num=fsize.substr(0,(fsize.length-2));
    newFsize = ((parseFloat(fsize) - 0.1)  )+ 'em';
  }
  else
    newFsize = (parseInt(fsize) - 2) + 'px';

  if (parseFloat(newFsize )>0)
	  document.body.style.fontSize = newFsize;
 
}

function getStyle(styleProp) 
{ 
   var x = document.body; 
   if (x.currentStyle) 
      var y = x.currentStyle[styleProp]; 
   else if (window.getComputedStyle) 
      var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp); 
   return y; 
} 

//checks formular 
// need var requiredarray=new Array('form_vorname','form_nachname','form_email');
// @param formid 
// need input id="name" around the fields
//<script language="javascript" type="text/javascript">
//            <!--                    
//            var requiredarray=new Array('form_name','form_nname','form_email','form_phone');
//            -->
//</script>  
//<input type="button" value="Senden" onclick="checkRequired(formid)" class="input-button" />

 function checkRequired(formid) {
             	
             	var result=true;
             	if (!requiredarray)
             		alert('no requiredarray');
             	
             	for(i=0;i<requiredarray.length;i++) {
             		//set back of styles
            		 document.getElementById(requiredarray[i]).style.border='';
            		 var lastChild=document.getElementById(requiredarray[i]).parentNode.lastChild;            		 
            		 if (lastChild.nodeName=='SPAN') 
            		  	document.getElementById(requiredarray[i]).parentNode.removeChild(lastChild);
            		//check each element, if empty mark it
								 if ((document.getElementById(requiredarray[i]).type=='checkbox' && document.getElementById(requiredarray[i]).checked==false) ||								 
								 	document.getElementById(requiredarray[i]).value=='') {
								   result=false;
								   //append the image:
								   	var newNode = document.createElement('span');								   	
										newNode.setAttribute('class','formerror');
  									newNode.innerHTML='&nbsp;';
								   document.getElementById(requiredarray[i]).parentNode.appendChild(newNode);
								   document.getElementById(requiredarray[i]).style.border = 'solid red 1px';
								 }
							}
							if (result) {
							 document.getElementById(formid).submit();
							}
							else {
							  alert('Bitte füllen Sie alle benötigten Felder aus!');
							  return false;
							}
}
             
    

/* swaps the first child of the two elemnets
*/
function swapElementChilds(one,two) {
	if (document.getElementById(one).firstChild) {
		sone = document.getElementById(one).firstChild;
 		oneclone = sone.cloneNode(true);
 		if (document.getElementById(two).firstChild) {
 			stwo = document.getElementById(two).firstChild;
 			twoclone = stwo.cloneNode(true); 			
 			document.getElementById(one).replaceChild(twoclone, sone);
 			document.getElementById(two).replaceChild(oneclone,stwo);
 		}
 	}
}
        
function switchElements(show,hide) {
		if (document.getElementById(show))
	              document.getElementById(show).style.display='block';
		if (document.getElementById(hide))
	              document.getElementById(hide).style.display='none';
	         return false;

}